import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/demo/tree',
    name: 'demo/tree',
    component: () => import(/* webpackChunkName: "about" */ '../views/demo/TreeView.vue')
  },
  {
    path: '/demo/login',
    name: 'demo/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/demo/LoginView.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/default',
    name: 'default',
    component: () => import('../views/DefaultView.vue'),
    children: [
      {
        path: '/system/user',
        name: 'system/user',
        component: () => import('../views/system/UserListView.vue')
      },
      {
        path: '/product/category',
        name: 'product/category',
        component: () => import('../views/product/CategoryView.vue')
      },
      {
        path: '/product/brand',
        name: 'product/brand',
        component: () => import('../views/product/BrandView.vue')
      },
      {
        path: '/product/add',
        name: 'product/add',
        component: () => import('../views/product/AddView.vue')
      },
      {
        path: '/order/list',
        name: 'order/list',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/ListView.vue')
      },
      {
        path: '/order/detail',
        name: 'order/detail',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/DetailView.vue')
      },
      {
        path: '/month/list',
        name: 'month/list',
        component: () => import( '../views/month/OrderListView.vue')
      },
      {
        path: '/month/detail',
        name: 'month/detail',
        component: () => import( '../views/month/OrderDetailView.vue')
      }
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
